/*************************************************************************
	> File Name: transport.h
	> Author: xuwenlong
	> Mail: myxuan475@126.com 
	> Created Time: 2018年04月12日 星期四 15时07分48秒
 ************************************************************************/

#ifndef __TRANSPORTS_H__
#define __TRANSPORTS_H__

#include "dbms.h"
#include <string>

using namespace std;

class transports:public dbms
{
public:
    transports(int id);
    BOOL inorup(S32 sample,U64 regtime,S32 timeout,S32 mode,const char *addr);
    BOOL insert(S32 sample,U64 regtime,S32 timeout,S32 mode,const char *addr);
    BOOL update(S32 sample,U64 regtime,S32 timeout,S32 mode,const char *addr);

    virtual void assignvalue(int argc, char **argv, char **azColName);
    virtual void clearall();

    S32 fsample();
    int itimeout();
    int imode();

    vector<transmgr_t> &gettransinfos() {return m_itrans_infos;}
    transmgr_t gettransinfo() {
        if (m_itrans_infos.size() > 0)
            return m_itrans_infos.at(0);
        transmgr_t tr;
        return tr;
    }
    transmgr_t gettransport_by_chn(const string &chn);
protected:

private:
    vector<transmgr_t>  m_itrans_infos;
};

#endif
